const express = require('express');
const parser = require('body-parser');

const app = express();

app.use(parser.json());
app.use(parser.urlencoded({ extended: false }));

app.use('/static', express.static('./public'));

app.use('/user', require('./router/user.js'));
app.use('/goods', require('./router/goods.js'));

app.use((err, req, res, next) => {
  console.log('凉了。。。。');
  res.send('哦豁~~哥们抱歉，服务器异常，请稍后重试！');
});

app.listen(80, () => {
  console.log('start at http://localhost');
});
